<script type="text/javascript"
     src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<head>
    <link rel="stylesheet" href="stylesheet_TMATS.css">
</head>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<title>
    T-MATS: Help for Temp2Enth Library Block
</title>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<body>
    <h1>
      T-MATS: Temp2Enth Library Block
    </h1>
<hr>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="purpose">
        Purpose
</div>

<p>
    This block can be used to emperically calculate enthalpy (<i>h</i>) from
    temperature (<i>T</i>) and fuel to air ratio (<i>FAR</i>).
    The enthalpy calculated will be total or static, depending on the input
    of either total temperature (<i>Tt</i>) or static temperature (<i>Ts</i>),
    respectively.

</p>

<br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="background">
        Background
</div>

<p>
    To compute the enthalpy, this block utilizes a table-lookup method based
    on data from standard thermodynamic tables for a combination of
    air and combusted hydrocarbons. The calculations are made
    from the built-in curve fit data, using the basic equation of:

    $$h = \frac{h_f*n_{f,p}+h_a*n_{a,p}}{n_{f,p}+n_{a,p}}$$

    in which

    $$h_a = d_{ha,i}*\Delta T^3 + c_{ha,i}*\Delta T^2 + b_{ha,i}*\Delta T + a_{ha,i} $$

    and

    $$h_f = d_{hf,i}*\Delta T^3 + c_{hf,i}*\Delta T^2 + b_{hf,i}*\Delta T + a_{hf,i} $$
    <br>

    In the above equations, <i>&Delta;T </i>  is the difference between the
    given temperature value and an index value that is obtained from a data
    array as a function of the integer value of one percent of the assigned
    gas temperature.
</p>
<p>
    Additionally, the variables <i>a</i>,<i> b</i>,<i> c</i>, and <i>d </i>
    are arrays of cubic spline-fit coefficients, based on the data tables.
</p>

<br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="instructions">
        Instructions
</div>

<p>
    To use this block:
    <ul>
        <li> Connect the temperature and fuel to air ratio inputs to the
        corresponding places on the block.
        <li> Connect the enthalpy output to the next block in your simulation.
    </ul>
</p>

<br><hr><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="inputs">
        Temp2Enth Inputs
</div>

<table>
    <tr><th> Input </th><th >Description</th></tr>
    <tr><td>T</td><td>Temperature [degR] </td></tr>
    <tr><td>FAR</td><td>Fuel to Air Ratio[frac]</td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="outputs">
        Temp2Enth Outputs
</div>

<table>
    <tr><th> Output </th><th> Description </th></tr>
    <tr><td>h</td><td>Enthalpy [BTU/lbm]</td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class="maskvars">
       Temp2Enth Mask Variables
</div>
<p>
    No mask variables are needed for this block, as all calculations are
    based on the input values.
</p>
<br><hr><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<div class = "errors">
    Potential Errors
</div>
<p>
    When using this block, you may receive one of the following errors/warnings. The table
    below lists the errors/warnings that you may see and the reason why it is being displayed.
</p>
<table>
    <tr><th> Error/Warning </th><th>Description</th></tr>
    <tr><td>Two inputs required</td><td>One or more inputs are not connected to the block.</td></tr>
    <tr><td>One output required</td><td>The output is not connected to anything.</td></tr>
    <tr><td>Temperature input must be a scalar</td><td>Error is displayed when the temperature
    input has more than one element. </td></tr>
    <tr><td>FAR input must be a scalar.</td><td>Error is displayed when the FAR input
    has more than one element.</td></tr>
</table>

<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
</body>